<script type="text/javascript">

chrome.extension.onRequest.addListener(
	function(request, sender, sendResponse){
		switch(request.type){
			case "viewImage":
				chrome.tabs.getSelected(function(tab){
					chrome.tabs.create({"selected":true, "index":tab.index, "url": "html/view.html?" + request.url});
				});
				break;
		}
	}
);

</script>
